#!/bin/bash
#!/bin/rm
#!/bin/sh
# 欢迎使用北斗卫星系统一键脚本

echo "即将搭建的是北斗卫星系统"
echo "准备开始安装"
read -p "回车后开始升级 ,取消操作请用 Ctrl+C 结束!"
echo "请输入你的内网ip" 
read -p "内网ip:" ip
echo
	if [ ! -n "$ip" ] ;
		then
			echo "开始启动"
		else
			echo "请输入内网ip"
	fi

bash ssall.sh 2>&1 | tee ssall.log

echo "ss代理搭建成功，请记住连接信息"
read -p "记住了吗？任意键继续！" 

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash
source ~/.bash_profile
nvm install v9.8.0
nvm alias default v9.8.0
yum -y install gcc-c++
yum -y install flex
yum -y install bison
wget http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz
tar -zxvf libpcap-1.8.1.tar.gz
cd libpcap-1.8.1/
./configure
make
make install

git clone -b 1.2.0 https://gitee.com/clorys/clorys.git
cd clorys/
npm i
npm i -g pino
npm install -g forever
forever start index.js sniff eth0 $ip | pino

echo
echo "搭建完成"
echo

cd /root/beidou/

rm -f /root/beidou/ssall.sh
rm -f /root/beidou/ssall.log
rm -f /root/beidou/README.md
rm -f /root/beidou/libpcap-1.8.1.tar.gz
rm -f /root/beidou/shadowsocks_python_qr.png
mv -f /root/beidou/start.sh /root/start.sh

rm $0